package com.hidtechs.popfax.iconifiedList;



import java.util.ArrayList;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.hardware.Camera.Size;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class IconifiedTextView extends LinearLayout {
     
     private TextView mText,mText1,mText2;
     private ImageView mIcon;
     private CheckBox checkBox;
     
     public IconifiedTextView(Context context, ArrayList<String> aIconifiedText) {
          super(context);

          /* First Icon and the Text to the right (horizontal),
           * not above and below (vertical) */
          this.setOrientation(HORIZONTAL);

          checkBox = new CheckBox(context);
          checkBox.setWidth(30);
          addView(checkBox, new LinearLayout.LayoutParams(
                  LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        
          
         /* mIcon = new ImageView(context);
          mIcon.setImageDrawable(aIconifiedText.getIcon());
          // left, top, right, bottom
          mIcon.setPadding(5, 2, 10, 2); // 5px to the right*/
          
          /* At first, add the Icon to ourself
           * (! we are extending LinearLayout) */
      /*    addView(mIcon,  new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));*/
          
          
          mText = new TextView(context);
          mText.setText(aIconifiedText.get(0));
          mText.setWidth(120);
          mText.setTextColor(Color.BLACK);
          
   //        Now the text (after the icon) 
          addView(mText, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
          
          mText1 = new TextView(context);
          mText1.setText(aIconifiedText.get(1));
          mText1.setWidth(50);
          mText1.setTextColor(Color.BLACK);
          /* Now the text (after the icon) */
          addView(mText1, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
          mText2 = new TextView(context);
          mText2.setText(aIconifiedText.get(2));
          mText2.setTextColor(Color.BLACK);
          /* Now the text (after the icon) */
          addView(mText2, new LinearLayout.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          
     }

    public void setText(ArrayList<String> words) {
          mText.setText(words.get(0));
          mText1.setText(words.get(1));
          mText2.setText(words.get(2));
     }
     
  /*   public void setIcon(Drawable bullet) {
          mIcon.setImageDrawable(bullet);
     }*/
}

